﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using venta_productos.LogicaNegocio;

namespace venta_productos.Presentacion
{
    /// <summary>
    /// Lógica de interacción para Fmodicar.xaml
    /// </summary>
    public partial class Fmodicar : Window
    {
        public Fmodicar()
        {
            InitializeComponent();
        }

        private void btn_consulta_Click(object sender, RoutedEventArgs e)
        {
            var prod =manejop.consultar(Convert.ToInt32(tb_consulta.Text));

            tb_num.Text=Convert.ToString(prod.nro_prod);
            tb_desc.Text=prod.dersc_prod;
            tb_preci.Text=Convert.ToString(prod.precio_u);

            MessageBox.Show("producto encontrado");
        }
        //boton modificar 
        private void btn_agregar_Click(object sender, RoutedEventArgs e)
        {
            manejop.modificarp(Convert.ToInt32(tb_consulta.Text),Convert.ToInt32(tb_num.Text),tb_desc.Text,Convert.ToInt32(tb_preci.Text));
            MessageBox.Show("Porducto modificado");
        }
    }
}
